package com.mengniu.commerce.sync.controller;


import com.alibaba.fastjson.JSONObject;
import com.mengniu.commerce.common.core.domain.R;
import com.mengniu.commerce.common.core.web.controller.BaseController;
import com.mengniu.commerce.common.log.annotation.Log;
import com.mengniu.commerce.common.log.enums.BusinessType;
import com.mengniu.commerce.sync.api.domain.WeiMengActDataModel;
import com.mengniu.commerce.sync.service.ActService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 行为数据创建controller
 *
 * @author zfw
 */
@RestController
@RequestMapping("/act")
@Slf4j
public class ActDataController extends BaseController
{
       @Autowired
    private ActService actService;

    @Log(title = "微盟行为数据创建管理", businessType = BusinessType.INSERT)
    @PostMapping("/createAct")
    public R<?> createAct(@RequestBody List<WeiMengActDataModel> createActModelList, String source)
    {
        log.info("微盟行为数据创建参数为:{},{}", JSONObject.toJSONString(createActModelList),source);
        return R.ok(actService.actInsert(createActModelList));

    }


}
